package com.zuoye;

import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);//构建输入对象
        System.out.println("请输入存储金额（1000起）：");
        double money = input.nextDouble();//获取存储金额
        System.out.println("请输入存储年限（1 2 3 5 ）：");
        int year = input.nextInt();//获取存储年限
        switch (year){//判断年限
            case 1:
                money = money * 1.0225;
                System.out.println("本息总额为： " + money);
                break;
            case 2:
                money = money * 1.027;
                System.out.println("本息总额为： " + money);
                break;
            case 3:
                money = money * 1.0325;
                System.out.println("本息总额为： " + money);
                break;
            case 5:
                money = money * 1.036;
                System.out.println("本息总额为： " + money);
                break;
            default:
                System.out.println("请输入正确年限");
        }
    }
}
